<?php
namespace Home\Controller;
use Think\Controller;
class ClubController extends Controller{
	public function addClub($data){
		$club = D('club');
		$club->clubname = $data['name'];
		$club->clubpic = $data['pic'];
		$club->instruction = $data['instruction'];
		$club->address = $data['address'];
		$club->phone = $data['phone'];
		$club->time = $data['time'];
		$result = $club->save();
		if($result != 0){
			$this->success("添加俱乐部成功！",U('showclub'));//url
		}else{
			$this->error("录入俱乐部信息有错！");
		}
	}

	public function deleteClub($cid){
		$club = D('club');
		$result = $club->where('clubid='.$cid)->delete();
		if($result == false){
			$this->error('删除俱乐部出错')
		}else{
			$this->success("删除成功",U(''));
		}
	}
}


?>